from app.settings.load_config import load_config

settings = load_config()

TORTOISE_CONFIG = {
    "connections": {
        "default": {
            "engine": "tortoise.backends.asyncpg",
            "credentials": {
                "host": settings.database.host,
                "port": settings.database.port,
                "user": settings.database.db_user,
                "password": settings.database.db_password,
                "database": settings.database.db_name,
            },
        },
    },
    "apps": {
        "models": {
            "models": [
                "aerich.models",
                "app.models.account_models",
                "app.models.region_models",
                "app.models.weatherforecast_models",
                "app.models.weather_models",
            ],
            "default_connection": "default",
        }
    },
}

TORTOISE_CONFIG_AERICH = {
    "connections": {
        "default": {
            "engine": "tortoise.backends.asyncpg",
            "credentials": {
                "host": settings.aerich.host,
                "port": settings.aerich.port,
                "user": settings.aerich.db_user,
                "password": settings.aerich.db_password,
                "database": settings.aerich.db_name,
            },
        },
    },
    "apps": {
        "models": {
            "models": [
                "aerich.models",
                "app.models.account_models",
                "app.models.region_models",
            ],
            "default_connection": "default",
        }
    },
}
